package open3366pvp.as3.dataStruct
{
	import flash.utils.ByteArray;
	
	import open3366pvp.as3.Open3366PvpEvent;
	
	/**
	 * 所有区信息
	 * @author mandyxiong
	 * 
	 */	
	public class AstZoneInfo implements IPvpInfo
	{
		public var gameId:uint;
		public var uid:String;
		public var zoneNum:int;
		public var zoneList:Array;
		
		public function parasData(data:ByteArray):void
		{
			gameId = data.readUnsignedInt();
			uid = data.readUTFBytes(32);
			zoneNum = data.readInt();
			zoneList = [];
			for(var i:int = 0; i < zoneNum; i++)
			{
				zoneList.push(new ZoneDirInfo(data));
			}
		}
		
		public function get eventType():String
		{
			return Open3366PvpEvent.GET_ZONE_LIST;
		}
		
		public function toString():String
		{
			var str:String = "uid :" + uid + ", gameId" + gameId + "\n";
			for(var i:int = 0; i < zoneNum; i++)
			{
				str += ("zoneId:" + zoneList[i].zoneId +  ", userCount:" + zoneList[i].userCount +  ", ispFlag:" + zoneList[i].ispFlag +";\n");
			}
			return "拉去所有区信息成功！！！     总区数：" + zoneNum + "\n" + str;
		}
	}
}